import os


def run(mode=3, processes_number=4, envs_number=128*2):

    str_0 = "export CUDA_VISIBLE_DEVICES=-1 && /home/devilmaycry/anaconda3/envs/tf-14.0/bin/python -u /tmp/PolicyNetwork_Version/PolicyNetwork_version.py"
    str_1 = " --mode=%d "%mode
    str_2 = " --processes_number=%d "%processes_number
    str_3 = " --envs_number=%d "%envs_number

    for i in range(50):
        os.system("mkdir mode_%d"%mode)
        os.system("mkdir mode_%d/envs_number_%d"%(mode, envs_number))
        os.system("mkdir mode_%d/envs_number_%d/processes_%d"%(mode, envs_number, processes_number))

        str_4 = "1>mode_%d/envs_number_%d/processes_%d/%d_out 2>&1 "%(mode, envs_number, processes_number, i)
        os.system(str_0+str_1+str_2+str_3+str_4)
        print(str_0+str_1+str_2+str_3+str_4)


#for envs_number in [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192]:
#for processes_number in [1, 2, 4, 8]


# envs_number [1, 2, 4, 8, 16, 32, 64, 128, 2048, 4096, 8192]
run(processes_number=4, envs_number=128)

#envs_number=10000*5 or *3  process_number=7 or 1

